#include("../_inc/_layout.html")
#@layout(post.title + " - Jboot Fly", "jboot,jbootfly,jboot社区,jpress", post.contentText(),"jie")
#define content()

#include("../_inc/_navigation.html",cid=post.category.id)

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
      <div class="fly-panel detail-box">
        <h1>#(post.title)</h1>
        <div class="fly-detail-info">
          <!-- <span class="layui-badge">审核中</span> -->
          <span class="layui-badge layui-bg-green fly-detail-column">#(post.category.name)</span>

          #if(post.isFinished())
           <span class="layui-badge" style="background-color: #5FB878;">已结</span>
          #else
          <span class="layui-badge" style="background-color: #999;">未结</span>
          #end

          #if(post.level > 0)
          <span class="layui-badge layui-bg-black">置顶#(post.level)</span>
          #end

          #if(post.isRecommend())
          <span class="layui-badge layui-bg-red">精帖</span>
          #end

          <div class="fly-admin-box" data-id="#(post.id)">

            #if(USER && (USER.isAdmin() || USER.id == post.user_id))
            <span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>
            #end

            #if(USER && USER.isAdmin())
              <span class="layui-btn layui-btn-xs jie-admin" type="setLevel" level="1" >置顶1</span>
              <span class="layui-btn layui-btn-xs jie-admin" type="setLevel" level="2" >置顶2</span>
              <span class="layui-btn layui-btn-xs jie-admin" type="setLevel" level="3" >置顶3</span>
              #if(post.level > 0)
              <span class="layui-btn layui-btn-xs jie-admin" type="setLevel" level="0" style="background-color:#ccc;">取消置顶</span>
              #end
              #if(post.isRecommend())
              <span class="layui-btn layui-btn-xs jie-admin" type="recommendCancel"  style="background-color:#ccc;">取消加精</span>
              #else
              <span class="layui-btn layui-btn-xs jie-admin" type="recommend"  rank="1">加精</span>
              #end
            #end

          </div>
          <span class="fly-list-nums"> 
            <a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> #(post.comment_count ?? 0)</a>
            <i class="iconfont" title="人气">&#xe60b;</i> #(post.view_count ?? 0)
          </span>
        </div>
        <div class="detail-about">
          <a class="fly-avatar" href="/user/#(post.user.id)">
            <img src="#(post.user.avatar)" alt="#(post.user.nickname)">
          </a>
          <div class="fly-detail-user">
            <a href="/user/#(post.user.id)" class="fly-link">
              <cite>#(post.user.nickname)</cite>
              <i class="iconfont icon-renzheng" title="认证信息：{{ rows.user.approve }}"></i>
              <i class="layui-badge fly-badge-vip">VIP3</i>
            </a>
            <span>2017-11-30</span>
          </div>
          <div class="detail-hits" id="LAY_jieAdmin" data-id="#(post.id)">
            <span style="padding-right: 10px; color: #FF7200">悬赏：#(post.pay_point) 元宝</span>
            #if(USER && (USER.isAdmin() || USER.id == post.user_id))
            <span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="/post/add/#(post.id)">编辑此贴</a></span>
            #end
          </div>
        </div>
        <div class="detail-body photos">
          #(post.content)
        </div>
      </div>

      <div class="fly-panel detail-box" id="flyReply">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>回帖</legend>
        </fieldset>

        <ul class="jieda" id="jieda">

          #for(comment : pageData.list)
          <li data-id="#(comment.id)">
            <a name="item-#(comment.id)"></a>
            <div class="detail-about detail-about-reply">
              <a class="fly-avatar" href="">
                <img src="#(comment.user.avatar)" alt=" ">
              </a>
              <div class="fly-detail-user">
                <a href="" class="fly-link">
                  <cite>#(comment.user.nickname)</cite>
                </a>
              </div>
              <div class="detail-hits">
                <span>2017-11-30</span>
              </div>
              #if(comment.isAdopted())
              <i class="iconfont icon-caina" title="最佳答案"></i>
              #end
            </div>
            <div class="detail-body jieda-body photos">
              #(comment.content)
            </div>
            <div class="jieda-reply">
              <span class="jieda-zan" type="zan">
                <i class="iconfont icon-zan"></i>
                <em>0</em>
              </span>
              <span type="reply">
                <i class="iconfont icon-svgmoban53"></i>
                回复
              </span>
              <div class="jieda-admin">
                #if(USER && (USER.isAdmin() || USER.id == post.user_id))
                <span type="edit">编辑</span>
                <span type="del">删除</span>
                <span class="jieda-accept" type="accept">采纳</span>
                #end
              </div>
            </div>
          </li>
          #end
          
          <!-- 无数据时 -->
          <!-- <li class="fly-none">消灭零回复</li> -->
        </ul>

        #if(pageData.totalPage > 1)
          #include("../_inc/_pagination.html")
        #end
        
        <div class="layui-form layui-form-pane">
          <form action="/api/commentAdd" method="post">
            <div class="layui-form-item layui-form-text">
              <a name="comment"></a>
              <div class="layui-input-block">
                <textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容"  class="layui-textarea fly-editor" style="height: 150px;"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="id" value="#(post.id)">
              <button class="layui-btn" lay-filter="*" lay-submit>提交回复</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="layui-col-md4">

      #include("../_inc/_hot_posts.html")
      

    </div>
  </div>
</div>

#end